<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Tekdaqc Firmware: TekDAQC_CalibrationTable.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customstyle.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="signature_logo_100x100.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tekdaqc Firmware
   &#160;<span id="projectnumber">1.0.0.0</span>
   </div>
   <div id="projectbrief">The firmware of the Tekdaqc.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_tek_d_a_q_c___calibration_table_8c.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">TekDAQC_CalibrationTable.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Implements a calibration lookup table for analog measurements.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &quot;<a class="el" href="_tek_d_a_q_c___debug_8h_source.html">TekDAQC_Debug.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_tek_d_a_q_c___calibration_table_8h_source.html">TekDAQC_CalibrationTable.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_tek_d_a_q_c___b_s_p_8h_source.html">TekDAQC_BSP.h</a>&quot;</code><br/>
<code>#include &quot;<a class="el" href="_telnet_server_8h_source.html">TelnetServer.h</a>&quot;</code><br/>
<code>#include &lt;string.h&gt;</code><br/>
<code>#include &lt;inttypes.h&gt;</code><br/>
</div>
<p><a href="_tek_d_a_q_c___calibration_table_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad82f81dbfbf24a20d6d3cd0854f80bd9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#ad82f81dbfbf24a20d6d3cd0854f80bd9">TekDAQC_Calibration_SetBaseGainValue</a> (uint32_t val, <a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer)</td></tr>
<tr class="memdesc:ad82f81dbfbf24a20d6d3cd0854f80bd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the base gain value to apply the calibration table to.  <a href="#ad82f81dbfbf24a20d6d3cd0854f80bd9">More...</a><br/></td></tr>
<tr class="separator:ad82f81dbfbf24a20d6d3cd0854f80bd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7adb48554d765127b2e082f83e933b9d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__data__types.html#ga0ecf26b576b9a54eca656b9be7ba6a06">bool</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a7adb48554d765127b2e082f83e933b9d">TekDAQC_CalibrationInit</a> (void)</td></tr>
<tr class="separator:a7adb48554d765127b2e082f83e933b9d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8b0adbe7504bd2b7350a842345c4357"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#ac8b0adbe7504bd2b7350a842345c4357">TekDAQC_GetGainCalibration</a> (<a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer, float temperature)</td></tr>
<tr class="memdesc:ac8b0adbe7504bd2b7350a842345c4357"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves a gain calibration value for the specified parameters.  <a href="#ac8b0adbe7504bd2b7350a842345c4357">More...</a><br/></td></tr>
<tr class="separator:ac8b0adbe7504bd2b7350a842345c4357"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a227419dde42e8109515594cf91e4f4cb"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a227419dde42e8109515594cf91e4f4cb">TekDAQC_GetOffsetCalibration</a> (<a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer)</td></tr>
<tr class="memdesc:a227419dde42e8109515594cf91e4f4cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves an offset calibration value for the specified parameters.  <a href="#a227419dde42e8109515594cf91e4f4cb">More...</a><br/></td></tr>
<tr class="separator:a227419dde42e8109515594cf91e4f4cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a70c28c72bea0847b4f573196a947c39b"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a70c28c72bea0847b4f573196a947c39b">TekDAQC_SetCalibrationMode</a> (void)</td></tr>
<tr class="memdesc:a70c28c72bea0847b4f573196a947c39b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enters calibration mode, enabling write access to the calibration table.  <a href="#a70c28c72bea0847b4f573196a947c39b">More...</a><br/></td></tr>
<tr class="separator:a70c28c72bea0847b4f573196a947c39b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1da0f59c5fdb39d8893541b828003493"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a1da0f59c5fdb39d8893541b828003493">TekDAQC_EndCalibrationMode</a> (void)</td></tr>
<tr class="memdesc:a1da0f59c5fdb39d8893541b828003493"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exits calibration mode, disabling write access to the calibration table.  <a href="#a1da0f59c5fdb39d8893541b828003493">More...</a><br/></td></tr>
<tr class="separator:a1da0f59c5fdb39d8893541b828003493"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fc98de46de5ba2db8b894c3377f4e82"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a0fc98de46de5ba2db8b894c3377f4e82">TekDAQC_SetSerialNumber</a> (char *serial)</td></tr>
<tr class="memdesc:a0fc98de46de5ba2db8b894c3377f4e82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the serial number of this TekDAQC.  <a href="#a0fc98de46de5ba2db8b894c3377f4e82">More...</a><br/></td></tr>
<tr class="separator:a0fc98de46de5ba2db8b894c3377f4e82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad319f18d04a69c97b403a1d7e0a27696"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#ad319f18d04a69c97b403a1d7e0a27696">TekDAQC_SetCalibrationLowTemperature</a> (float temp)</td></tr>
<tr class="memdesc:ad319f18d04a69c97b403a1d7e0a27696"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the temperature value for the lowest temperature entry of the table.  <a href="#ad319f18d04a69c97b403a1d7e0a27696">More...</a><br/></td></tr>
<tr class="separator:ad319f18d04a69c97b403a1d7e0a27696"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d5db9985fece5b11736ce8cdb1a786a"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a3d5db9985fece5b11736ce8cdb1a786a">TekDAQC_SetCalibrationHighTemperature</a> (float temp)</td></tr>
<tr class="memdesc:a3d5db9985fece5b11736ce8cdb1a786a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the temperature value for the highest temperature entry of the table.  <a href="#a3d5db9985fece5b11736ce8cdb1a786a">More...</a><br/></td></tr>
<tr class="separator:a3d5db9985fece5b11736ce8cdb1a786a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a734a97e9c887d2929f90f8f7ea99d9ab"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a734a97e9c887d2929f90f8f7ea99d9ab">TekDAQC_SetCalibrationStepTemperature</a> (float temp)</td></tr>
<tr class="memdesc:a734a97e9c887d2929f90f8f7ea99d9ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the temperature step value for the temperature entries of the table.  <a href="#a734a97e9c887d2929f90f8f7ea99d9ab">More...</a><br/></td></tr>
<tr class="separator:a734a97e9c887d2929f90f8f7ea99d9ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e4d430f2646f91dd066418b77ec1a81"><td class="memItemLeft" align="right" valign="top">FLASH_Status&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a1e4d430f2646f91dd066418b77ec1a81">TekDAQC_SetGainCalibration</a> (uint32_t cal, <a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer, float temperature)</td></tr>
<tr class="memdesc:a1e4d430f2646f91dd066418b77ec1a81"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the gain calibration value for the specified parameters.  <a href="#a1e4d430f2646f91dd066418b77ec1a81">More...</a><br/></td></tr>
<tr class="separator:a1e4d430f2646f91dd066418b77ec1a81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0734f2de87e15e76947259596af412a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a0734f2de87e15e76947259596af412a5">TekDAQC_SetOffsetCalibration</a> (uint32_t cal, <a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer)</td></tr>
<tr class="memdesc:a0734f2de87e15e76947259596af412a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the offset calibration value for the specified parameters.  <a href="#a0734f2de87e15e76947259596af412a5">More...</a><br/></td></tr>
<tr class="separator:a0734f2de87e15e76947259596af412a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d36462f3a897fe1d2d30feca721053c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html#a4d36462f3a897fe1d2d30feca721053c">TekDAQC_SetBaseGainCalibration</a> (uint32_t cal, <a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a> rate, <a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a> gain, <a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a> buffer)</td></tr>
<tr class="memdesc:a4d36462f3a897fe1d2d30feca721053c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the base gain calibration value for the specified parameters.  <a href="#a4d36462f3a897fe1d2d30feca721053c">More...</a><br/></td></tr>
<tr class="separator:a4d36462f3a897fe1d2d30feca721053c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Implements a calibration lookup table for the TekDAQC's analog measurements. 32 bit gain calibration values are stored which can be applied to the ADC's measurement. The table has the ability to store values for each gain, sample rate and buffer setting on the TekDAQC, as well as for various temperature data points. When requesting a value, a temperature must be specified and the value will automatically be interpolated from the closest high and low temperature data points.</p>
<p>Since the board has the ability to in the field perform offset calibrations, no values are specified for the offset register in the table. Instead they are determined at run time by performing a complete offset calibration and storing the results in a RAM table.</p>
<dl class="section author"><dt>Author</dt><dd>Jared Woolston (<a href="#" onclick="location.href='mai'+'lto:'+'jwo'+'ol'+'sto'+'n@'+'ten'+'ki'+'v.c'+'om'; return false;">jwool<span style="display: none;">.nosp@m.</span>ston<span style="display: none;">.nosp@m.</span>@tenk<span style="display: none;">.nosp@m.</span>iv.c<span style="display: none;">.nosp@m.</span>om</a>) </dd></dl>
<dl class="section since"><dt>Since</dt><dd>v1.0.0.0 </dd></dl>

<p>Definition in file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ad82f81dbfbf24a20d6d3cd0854f80bd9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TekDAQC_Calibration_SetBaseGainValue </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the base gain calibration value. This value is added to the value retrieved from the table and allows the board to adjust its gain to remove thermal EMF and other environmental errors.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">val</td><td>uint32_t The gain calibration value. </td></tr>
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to lookup for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to lookup for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to lookup for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00253">253</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a7adb48554d765127b2e082f83e933b9d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__data__types.html#ga0ecf26b576b9a54eca656b9be7ba6a06">bool</a> TekDAQC_CalibrationInit </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initializes the calibration table for read operations.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">bool</td><td>Always TRUE. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00268">268</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1da0f59c5fdb39d8893541b828003493"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TekDAQC_EndCalibrationMode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Exits calibration mode, locking the FLASH sector against unintended write operations.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00409">409</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="ac8b0adbe7504bd2b7350a842345c4357"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t TekDAQC_GetGainCalibration </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>temperature</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Retrieve the gain calibration value for the specified sampling parameters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to lookup for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to lookup for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to lookup for. </td></tr>
    <tr><td class="paramname">temperature</td><td>float The temperature value to lookup for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">The</td><td>determined calibration value. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00287">287</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a227419dde42e8109515594cf91e4f4cb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t TekDAQC_GetOffsetCalibration </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Retrieve the offset calibration value for the specified sampling parameters.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to lookup for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to lookup for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to lookup for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">The</td><td>determined calibration value. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00342">342</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a4d36462f3a897fe1d2d30feca721053c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TekDAQC_SetBaseGainCalibration </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the base gain calibration value for the specified parameters. This method does not require the board to be in calibration mode and only stores the values in a RAM lookup table.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cal</td><td>uint32_t The calibration value to write. </td></tr>
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to write for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to write for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to write for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none.</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00549">549</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a3d5db9985fece5b11736ce8cdb1a786a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetCalibrationHighTemperature </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>temp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the high temperature for which calibration data exists. This is the highest temperature for which we have valid calibration data. This method requires that the board be in calibration mode and will return FLASH_ERROR_WRP if it is not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">temp</td><td>float The temperature value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>FLASH_COMPLETE on success, or the error status on failure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00474">474</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="ad319f18d04a69c97b403a1d7e0a27696"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetCalibrationLowTemperature </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>temp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the low temperature for which calibration data exists. This is the lowest temperature for which we have valid calibration data. This method requires that the board be in calibration mode and will return FLASH_ERROR_WRP if it is not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">temp</td><td>float The temperature value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>FLASH_COMPLETE on success, or the error status on failure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00457">457</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a70c28c72bea0847b4f573196a947c39b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetCalibrationMode </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Enter calibration mode. NOTE: Calling this method will erase the calibration table.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>The status of the FLASH operations. Returns FLASH_COMPLETE on success. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00357">357</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a734a97e9c887d2929f90f8f7ea99d9ab"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetCalibrationStepTemperature </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>temp</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the temperature step for the calibration data points. This method requires that the board be in calibration mode and will return FLASH_ERROR_WRP if it is not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">temp</td><td>float The temperature step value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>FLASH_COMPLETE on success, or the error status on failure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00490">490</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a1e4d430f2646f91dd066418b77ec1a81"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetGainCalibration </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>temperature</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the gain calibration value for the specified parameters. This method requires that the board be in calibration mode and will return FLASH_ERROR_WRP if it is not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cal</td><td>uint32_t The calibration value to write. </td></tr>
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to write for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to write for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to write for. </td></tr>
    <tr><td class="paramname">temperature</td><td>float The temperature value to write for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>FLASH_COMPLETE on success, or the error status on failure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00510">510</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a0734f2de87e15e76947259596af412a5"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TekDAQC_SetOffsetCalibration </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>cal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gab0437f81aad031aadf3e05dd5fe0a731">ADS1256_SPS_t</a>&#160;</td>
          <td class="paramname"><em>rate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#gace2e231df7cd3598eb26d5ff51171701">ADS1256_PGA_t</a>&#160;</td>
          <td class="paramname"><em>gain</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__ads1256__driver.html#ga12f71f8fc93fe63fb3c855ddd2070890">ADS1256_BUFFER_t</a>&#160;</td>
          <td class="paramname"><em>buffer</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes the offset calibration value for the specified parameters. This method does not require the board to be in calibration mode and only stores the values in a RAM lookup table.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cal</td><td>uint32_t The calibration value to write. </td></tr>
    <tr><td class="paramname">rate</td><td>ADS1256_SPS_t The sample rate to write for. </td></tr>
    <tr><td class="paramname">gain</td><td>ADS1256_PGA_t The gain to write for. </td></tr>
    <tr><td class="paramname">buffer</td><td>ADS1256_BUFFER_t The buffer setting to write for. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">none.</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00530">530</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
<a class="anchor" id="a0fc98de46de5ba2db8b894c3377f4e82"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">FLASH_Status TekDAQC_SetSerialNumber </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>serial</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Writes a the provided serial number to the serial number area of the calibration table. This method requires that the board be in calibration mode and will return FLASH_ERROR_WRP if it is not.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">serial</td><td>char* Pointer to a C-String containing the board serial number. Expected to be BOARD_SERIAL_NUM_LENGTH in size. </td></tr>
  </table>
  </dd>
</dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">FLASH_Status</td><td>FLASH_COMPLETE on success, or the error status on failure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html#l00426">426</a> of file <a class="el" href="_tek_d_a_q_c___calibration_table_8c_source.html">TekDAQC_CalibrationTable.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_8e5de21ae2c0e2e52ebd9b2e1880b407.html">TekDAQC_Libraries_Firmware</a></li><li class="navelem"><a class="el" href="dir_67f0fcbf6c112b8aef12a4e483003963.html">src</a></li><li class="navelem"><a class="el" href="_tek_d_a_q_c___calibration_table_8c.html">TekDAQC_CalibrationTable.c</a></li>
    <li class="footer">Generated on Tue Mar 18 2014 17:47:45 for Tekdaqc Firmware by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
